-- slime_immunity
-- create by zhuangsl
-- 特定冈布奥装备时，免疫某种状态

return {
    apply = function(prop, baseValue)
        -- 提升的值
        return baseValue + prop[3];
    end,

    -- 判断是否免疫
    trigger = function(who, prop, statusId)
        local arr = string.explode(prop[2], "_");

        -- 指定的状态
        if statusId ~= tonumber(arr[2]) then
            return false;
        end

        -- 指定的冈布奥
        local classId = ME.user.dbase:query("active_pet", 0);
        if classId ~= tonumber(arr[1]) then
            return false;
        end

        return true;
    end,

    desc = function(prop)
        local row = PropM.getRow(prop[1]);
        local desc = row.desc;

        local arr = string.explode(prop[2], "_");

        -- 替换冈布奥名称
        desc = string.gsub(desc, "{0}", PetM.query(tonumber(arr[1]), "name"));

        -- 状态名称
        desc = string.gsub(desc, "{1}", CombatStatusM.query(tonumber(arr[2]), "name"));

        return desc;
    end,

    record = function(target, prop, path)
        return false;
    end
};
